The toolkit has facilities for letting the user select and configure a scanner from among all installed scanner drivers. Selecting a driver does not load it for the application to use. So, how does the application load the currently-selected scanner driver?
The function IG_ISIS_drv_get_scan_name() provides an easy solution.
IG_ISIS_drv_get_scan_name() retrieves and fills in the currently-selected scanner by reading the [Scanner] section of the SETSCAN.INI file. If no scanner is currently selected, IG_ISIS_drv_get_scan_name will return IG_ISIS_ERR_NOCURSCANNER .
If no name is set and the hWnd parameter is not zero, the toolkit attempts to establish a current scanner by calling IG_ISIS_drv_set_scan_name() and displaying the Select Scanner dialog box.
The following program fragment shows how to load and unload the currently-selected driver.
Copy Code | |
---|---|
HISISDRV hDriver; char lpcDriverName[255]; IG_ISIS_drv_get_scan_name(hWnd or 0, lpcDriverName); IG_ISIS_drv_load((char FAR *)0, lpcDriverName, &hDriver, 0); IG_ISIS_drv_init(hDriver, lpcDriverName, 0); . . . /* The driver may now be used by referencing &hDriver */ . . . IG_ISIS_drv_unload(hDriver); |